package com.leonzhangxf.service;

import com.leonzhangxf.domain.Article;
import com.leonzhangxf.repository.ArticleRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

/**
 * @author leonzhangxf
 */
@Service
public class ArticleServiceImpl implements ArticleService {

    private final ArticleRepository articleRepository;

    public ArticleServiceImpl(ArticleRepository articleRepository) {
        this.articleRepository = articleRepository;
    }

    @Override
    public Page<Article> findPageByPageRequest(PageRequest pageRequest) {
        return articleRepository.findAll(pageRequest);
    }
}
